﻿/*
 * Created by SharpDevelop.
 * User: user
 * Date: 21.09.2012
 * Time: 14:27
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using ServicesPayments.objects;

namespace ServicesPayments
{
	/// <summary>
	/// Description of MainForm.
	/// </summary>
	public partial class MainForm : Form
	{
		public MainForm()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
		}

        private void button1_Click(object sender, EventArgs e)
        {
           List<objects.objectUser> _lstUsers= new List<objectUser>
                                                   {
                                                       new objectUser{Id = 1,Name = "User1"},
                                                       new objectUser{Id = 2,Name = "User2"},
                                                       new objectUser{Id = 3,Name = "User3"},
                                                       new objectUser{Id = 4,Name = "User4"}
                                                   };


            var frm = UIFactory.Instance.CreateCatalogueForm<objectUser>();
            frm.DataSource = _lstUsers;
            frm.OnModeChanged+= new FormModeChangeHandler(frm_onModeChange);
            frm.ShowDialog();            
            
        }

        void frm_onModeChange(object sender, FormModeChangeEventArgs e)
        {
        	MessageBox.Show(e.NewMode.ToString());
        }
	}
}
